/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AnuncioViewImpl.java
 *
 * Created on 27-ene-2011, 0:56:54
 */

package Vista.Anuncio;

import Controlador.AnuncioController;
import Modelo.AnuncioModel;
import Modelo.Entidades.Alumno;
import Vista.AbstractViewImpl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/*
 *  Proyecto eJAM [G12]
 *  Miembros:
 *      - Javier Ruiz Hidalgo
 *      - Adrian Ramos Cápitas
 *      - Miguel Alejandro Esteban Ordóñez
 */

public class AnuncioViewImpl extends AbstractViewImpl<AnuncioController, AnuncioModel> implements AnuncioView {

    private ConsultaAnunciosView consultaAnunciosView;

    /** Creates new form AnuncioViewImpl */
    public AnuncioViewImpl() {
        initComponents();

        this.consultaAnunciosView = new ConsultaAnunciosView(this);

        this.jPestañasGestionAnuncios.add("Consulta de Anuncios", consultaAnunciosView);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPestañasGestionAnuncios = new javax.swing.JTabbedPane();

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPestañasGestionAnuncios, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPestañasGestionAnuncios, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    @Override
    protected void refresh() {
        this.consultaAnunciosView.refrescaVista();
    }

    public void fireAltaAnuncioGesture(Alumno alumno, boolean is_leido, String descripcion) {
        List<Serializable> datos = new ArrayList();
        datos.add(alumno);
        datos.add(is_leido);
        datos.add(descripcion);

        this.getController().nuevaEntidadGesture(datos);
    }

     void fireMarcaAnuncioComoLeidoGesture(int ID) {
        this.getController().marcaComoLeidoGesture(ID);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane jPestañasGestionAnuncios;
    // End of variables declaration//GEN-END:variables

}
